package com.zenika.zenbinding.client.handler;

import com.google.gwt.user.client.ui.Widget;

/**
 * Handler goal is to manage a widget and communicate with a Model. It
 * initializes the value displayed by the widget and listen it for change. When
 * the value change, it returns the new value to the model. The handler can also
 * modify the widget style.
 * @author Zenika
 */
public interface Handler {

	/**
	 * Set the widget style as regular.
	 */
	public void setRegularStyle();

	/**
	 * Modify the widget style in an error style.
	 */
	public void setErrorStyle();

	/**
	 * Return the underlying widget.
	 */
	public Widget getWidget();

	/**
	 * Returns the raw value contained in the widget.
	 */
	public Object getValue();

}
